/*
    所有定义routes接口入口
*/

var express = require('express');
var page = require("./page");
var users = require("./users");
var login = require("./login");
var home = require("./home");
var forum = require("./forum");
var cookie = require("cookie-parser");

var admin = express();
/* 所有页面html的入口，page.js文件下进行定义*/

admin.all('*', function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "X-Requested-With");
    res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
    res.header("X-Powered-By",' 3.2.1');
    res.header("Content-Type", "text/html");
    next();
});

admin.use("/",page);

admin.all('*', function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "X-Requested-With");
    res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
    res.header("X-Powered-By",' 3.2.1');
    res.header("Content-Type", "application/json;charset=utf-8");
    next();
});
//admin.use("/users",users);
admin.use("/login",login);
admin.use("/home",home);
admin.use("/forum",forum);

module.exports = admin;